Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only build verb schema for non-nil refs #1591

Merged
merged 1 commit into from
May 28, 2024

Conversation

wesbillman
Copy link
Collaborator

Fixes #1578

We might want more protection around refs not being found, but I wasn't sure how to make this allow for TypeParameters and also keep that protection. This fix gets things working again, but we might want to revisit this as well.

@wesbillman wesbillman requested a review from alecthomas as a code owner May 28, 2024 19:35
@wesbillman wesbillman requested review from a team and matt2e and removed request for a team May 28, 2024 19:35
@ftl-robot ftl-robot mentioned this pull request May 28, 2024
Comment on lines +47 to +52
if decl, ok := sch.Resolve(n).Get(); ok {
*verbString += decl.String() + "\n\n"
err := visitNode(sch, decl, verbString)
if err != nil {
return err
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alecthomas this change sort of undoes the change that was made here: 3c91886#diff-cf10aad402fc38d803d69ee88de91fa8b7f27d33ea52e2dc67ebb6749dfe61afR47-R50 so I wanted to call it out.

Maybe there's a better approach we can use here, but wanted to fix the broken console until then.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks identical to me, just reordered, or am I missing something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah it's very similar. The difference is that this one doesn't error if the decl cannot be resolved, it just skips it. This was happening for Body in the HttpRequest<Body> data types. Since Body isn't a ref that it can find.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So instead of:

return fmt.Errorf("failed to resolve %s", n)

it just moves on to the next Ref

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aaah I see, makes sense

@wesbillman wesbillman merged commit 662a289 into main May 28, 2024
28 checks passed
@wesbillman wesbillman deleted the fix-console-error-on-nil-refs branch May 28, 2024 20:06
@matt2e matt2e added the approved Marks an already closed PR as approved label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Marks an already closed PR as approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ftl console fails to load deployments
3 participants